void main() {
  List myList = ["香蕉", "苹果", "橘子"];

  //增加数据
  myList.add("西瓜"); //增加单个数据
  print(myList);
  myList.addAll(["柿子", "菠萝"]); //拼接集合
  print(myList);
  print("----------");

  //indexof 查找索引 如果找到返回结果下标 找不到返回-1
  print(myList.indexOf("西瓜"));
  print(myList.indexOf("element"));
  print("----------");

  //remove 移除数据 removeAt 根据索引移除
  print(myList);
  myList.remove("菠萝");
  print(myList);
  myList.removeAt(3);
  print(myList);
  print("----------");

  //fillRange 修改数据 左闭右开
  List newMyList = ["香蕉", "苹果", "橘子"];
  newMyList.fillRange(1, 2, "aaa");
  print(newMyList);
  print("----------");

  //insert insertAll 插入 插入多个数据
  newMyList.insert(1, "西瓜");
  print(newMyList);
  newMyList.insertAll(2, ["白菜", "萝卜"]);
  print(newMyList);
  print("----------");

  //List转化为字符串 join()
  var str = newMyList.join("-");
  print(str);
  print(str is String);
}
